name: CI/CD

on: push

jobs:
  build:
    name: Building image
    runs-on: ubuntu-latest
    steps:
      - name: Checkout the repo
        uses: actions/checkout@v2
        
      - name: DockerHub login
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
        
      - name: Build image
        run: docker compose build

      - name: Push image to Dockerhub
        run: docker compose push